/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Inter_Editor.java
 *
 * Created on Jul 12, 2011, 8:24:44 PM
 */

package sources;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FileDialog;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Label;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JEditorPane;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JToolBar;

/**
 *
 * @author owner
 */
public class Inter_Editor extends javax.swing.JFrame {

    /** Creates new form Inter_Editor */
    private JToolBar toolbar;
    private JPanel centerpanel;
    private JScrollPane scrollbar;
    private JEditorPane rowtext;
    static JEditorPane textpane;
    private String myBuffer;
    private String myBuffer2;

    private int rec;
    private int leng1;
    private int leng2;

    private String macro;

    private boolean filesaved;
    private int fileNum;

    private String filepath;                                        //get opened file's path for
    private String filename;
    private String lines;

    private File file;

    public Inter_Editor() {
        initComponents();

        this.setSize(800,700);

        toolbar = new JToolBar();
        centerpanel = new JPanel(new BorderLayout());
        scrollbar = new JScrollPane(centerpanel);

        rowtext = new JEditorPane();
        Font f = new Font("DialogInput", Font.PLAIN, 14);
        rowtext.setFont(f);
        rowtext.setEditable(false);
        rowtext.setBackground(new Color(240,240,240));

        textpane = new JEditorPane();
        textpane.setFont(f);
        textpane.setText("");

        buildToolBar();

        centerpanel.add(rowtext,"West");
        centerpanel.add(textpane,"Center");

        this.add(toolbar,"North");
        this.add(scrollbar,"Center");

        myBuffer = "";
        myBuffer2 = "";
        macro = "";
        rec = 0;

        filesaved = false;
        fileNum = 1;
        filepath = "";                                         //get opened file's path for
        filename = "";

        lines = "";
        jMenuItem15.setEnabled(false);

    }

    public void buildToolBar()
    {
        ImageIcon newpicture = new ImageIcon("pic/new.gif");
        JButton newbutton = new JButton(newpicture);
        newbutton.setToolTipText("New");
        newbutton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newDocActionPerformed(evt);
            }
        });

        ImageIcon openpicture = new ImageIcon("pic/open.gif");
        JButton openbutton = new JButton(openpicture);
        openbutton.setToolTipText("Open");
        openbutton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                OpenDocActionPerformed(evt);
            }
        });

        ImageIcon savepicture = new ImageIcon("pic/save.gif");
        JButton savebutton = new JButton(savepicture);
        savebutton.setToolTipText("Save");
        savebutton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SaveDocActionPerformed(evt);
            }
        });


        ImageIcon copypicture = new ImageIcon("pic/copy.gif");
        JButton copybutton = new JButton(copypicture);
        copybutton.setToolTipText("Copy");
        copybutton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem6ActionPerformed(evt);
            }
        });
       
        ImageIcon cutpicture = new ImageIcon("pic/cut.gif");
        JButton cutbutton = new JButton(cutpicture);
        cutbutton.setToolTipText("Cut");
        cutbutton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem7ActionPerformed(evt);
            }
        });

        ImageIcon pastepicture = new ImageIcon("pic/paste.gif");
        JButton pastebutton = new JButton(pastepicture);
        pastebutton.setToolTipText("Paste");
        pastebutton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem12ActionPerformed(evt);
            }
        });

        ImageIcon undopicture = new ImageIcon("pic/undo.png");
        JButton undobutton = new JButton(undopicture);
        undobutton.setToolTipText("Undo");

        ImageIcon redopicture = new ImageIcon("pic/redo.png");
        JButton redobutton = new JButton(redopicture);
        redobutton.setToolTipText("Redo");

        toolbar.setLayout(new FlowLayout(FlowLayout.LEFT));
        toolbar.add(newbutton);
        toolbar.add(openbutton);
        toolbar.add(savebutton);
        toolbar.addSeparator();
        toolbar.add(copybutton);
        toolbar.add(cutbutton);
        toolbar.add(pastebutton);
        toolbar.addSeparator();
        toolbar.add(undobutton);
        toolbar.add(redobutton);
        toolbar.addSeparator();
       
       
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem8 = new javax.swing.JMenuItem();
        jMenuItem9 = new javax.swing.JMenuItem();
        jMenuItem6 = new javax.swing.JMenuItem();
        jMenuItem7 = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        jMenuItem10 = new javax.swing.JMenuItem();
        jMenuItem11 = new javax.swing.JMenuItem();
        jSeparator2 = new javax.swing.JPopupMenu.Separator();
        jMenuItem12 = new javax.swing.JMenuItem();
        jMenuItem13 = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        jMenuItem14 = new javax.swing.JMenuItem();
        jMenuItem15 = new javax.swing.JMenuItem();
        jMenuItem16 = new javax.swing.JMenuItem();
        jMenu4 = new javax.swing.JMenu();
        jMenuItem17 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jMenu1.setText("File");
        jMenu1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenu1ActionPerformed(evt);
            }
        });

        jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem1.setText("New");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newDocActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem2.setText("Open");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                OpenDocActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem2);

        jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem3.setText("Save");
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SaveDocActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem3);

        jMenuItem4.setText("Save As");
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SaveDocActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem4);

        jMenuItem5.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem5.setText("Exit");
        jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ExitDocActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem5);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Edit");

        jMenuItem8.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem8.setText("Find");
        jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                FindActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem8);

        jMenuItem9.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem9.setText("Replace");
        jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem9ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem9);

        jMenuItem6.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem6.setText("Copy");
        jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem6ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem6);

        jMenuItem7.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem7.setText("Cut");
        jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem7ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem7);
        jMenu2.add(jSeparator1);

        jMenuItem10.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem10.setText("ACopy");
        jMenuItem10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem10ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem10);

        jMenuItem11.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem11.setText("ACut");
        jMenuItem11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem11ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem11);
        jMenu2.add(jSeparator2);

        jMenuItem12.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem12.setText("Paste");
        jMenuItem12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem12ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem12);

        jMenuItem13.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem13.setText("SelectAll");
        jMenuItem13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem13ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem13);

        jMenuBar1.add(jMenu2);

        jMenu3.setText("Macro");

        jMenuItem14.setText("Start Recording");
        jMenuItem14.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                startRecActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItem14);

        jMenuItem15.setText("Stop Recording");
        jMenuItem15.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                stopRecActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItem15);

        jMenuItem16.setText("Play Back");
        jMenuItem16.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                playRecActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItem16);

        jMenuBar1.add(jMenu3);

        jMenu4.setText("?");

        jMenuItem17.setText("About");
        jMenuItem17.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem17ActionPerformed(evt);
            }
        });
        jMenu4.add(jMenuItem17);

        jMenuBar1.add(jMenu4);

        setJMenuBar(jMenuBar1);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenu1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenu1ActionPerformed

    private void ExitDocActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ExitDocActionPerformed
        this.setVisible(false);
        this.dispose();
    }//GEN-LAST:event_ExitDocActionPerformed

    private void newDocActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newDocActionPerformed
     if( filesaved == true || textpane.getText().equals("")) { // || lines.equals(textpane.getText())){
        textpane.setText("");
        setTitle("NotePad *** " + ++fileNum);
        filesaved = false;

        // saveinfotextfield.setText("null");
        //   filepath = "";
        //   lineshow = "1\n";
        //   lines = "";
        textpane.requestFocus();
     }
     else{
       InfoDialog info = new InfoDialog(this, true);
       Label message = new Label("PLEASE SAVE THE CURRENT FILE");
       message.setAlignment(java.awt.Label.CENTER);
       info.add(message);
       info.setLocation(this.getHeight()/2, this.getWidth()/2);
       info.setVisible(true);
       //,MainFrame.this.getX(),MainFrame.this.getY(),MainFrameWidth,MainFrameHeight) ;
     }
    }//GEN-LAST:event_newDocActionPerformed

    private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
        textpane.copy();
    }//GEN-LAST:event_jMenuItem6ActionPerformed

    private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
        textpane.cut();
    }//GEN-LAST:event_jMenuItem7ActionPerformed

    private void jMenuItem10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem10ActionPerformed
         String selectedText = textpane.getSelectedText();
            if(selectedText != null){
                myBuffer = myBuffer+selectedText;
                Toolkit toolkit = Toolkit.getDefaultToolkit();
                Clipboard clipboard = toolkit.getSystemClipboard();
                StringSelection strSel = new StringSelection(myBuffer);
                clipboard.setContents(strSel, null);
            }
    }//GEN-LAST:event_jMenuItem10ActionPerformed

    private void jMenuItem12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem12ActionPerformed
        textpane.paste();
    }//GEN-LAST:event_jMenuItem12ActionPerformed

    private void jMenuItem13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem13ActionPerformed
        textpane.selectAll();
    }//GEN-LAST:event_jMenuItem13ActionPerformed

    private void jMenuItem11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem11ActionPerformed
         String selectedText = textpane.getSelectedText();
         if(selectedText != null){
            myBuffer2 = myBuffer2+selectedText;
            textpane.cut();
            Toolkit toolkit = Toolkit.getDefaultToolkit();
            Clipboard clipboard = toolkit.getSystemClipboard();
            StringSelection strSel = new StringSelection(myBuffer2);
            clipboard.setContents(strSel, null);
         }
    }//GEN-LAST:event_jMenuItem11ActionPerformed

    private void jMenuItem17ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem17ActionPerformed
        AboutDialog aboutD = new AboutDialog(this, true);
        aboutD.setVisible(true);
        

    }//GEN-LAST:event_jMenuItem17ActionPerformed

    private void startRecActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startRecActionPerformed
        /*** FIRST MACRO I DID SIMIMALY TO NOTEPAD++ ***/

            if(rec == 0){
                jMenuItem15.setEnabled(true);
                rec = 1;
                jMenuItem16.setEnabled(true);
                leng1 = textpane.getText().length();
                macro = textpane.getText().substring(leng1);
            }
    }//GEN-LAST:event_startRecActionPerformed

    private void playRecActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_playRecActionPerformed
        /*** FIRST MACRO I DID SIMIMALY TO NOTEPAD++ ***/
            if(rec == 0)
                textpane.setText(textpane.getText()+macro);
    }//GEN-LAST:event_playRecActionPerformed

    private void stopRecActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_stopRecActionPerformed
        rec = 0;
        leng2 = textpane.getText().length();
	macro = textpane.getText().substring(leng1, leng2);
        jMenuItem15.setEnabled(false);
        
    }//GEN-LAST:event_stopRecActionPerformed

    private void OpenDocActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OpenDocActionPerformed
          if(filesaved == true || textpane.getText().equals("")){ // || MainFrame.this.lines.equals(textpane.getText())){
                JFileChooser chooser = new JFileChooser();   //Open a chooseDialog
                int state = chooser.showOpenDialog(null);
                file = chooser.getSelectedFile();            //get file directory
                if(file != null && state == JFileChooser.APPROVE_OPTION){
                    String aline="";
                    lines ="";
                    try{
                        FileReader reader = new FileReader(file);       //use inputstream,get file name
                        BufferedReader bf = new BufferedReader(reader); //buffer file information
                        do{
                        aline = bf.readLine();                          //read information from buffer
                        if(aline != null)
                            lines += (aline+"\r\n");                      //read all lines
                        }while(aline != null);
                        reader.close();                                 //close stream
                        bf.close();
                        textpane.setText(lines);
                     //   saveinfotextfield.setText(chooser.getSelectedFile().getParent());
                        filepath = chooser.getSelectedFile().getParent();
                        filename = chooser.getSelectedFile().getName();
                        filesaved = true;
                        setTitle(chooser.getSelectedFile().getName());  //reset Frame name
                    }catch(Exception e1)
                        {
                            InfoDialog info = new InfoDialog(this, true);
                            Label message = new Label("TRIED TO OPEN A WRONG FILE");
                            message.setAlignment(java.awt.Label.CENTER);
                            info.add(message);
                            info.setLocation(this.getHeight()/2, this.getWidth()/2);
                            info.setVisible(true);
                    }
                }
            }
            else{
                    InfoDialog info = new InfoDialog(this, true);
                    Label message = new Label("PLEASE SAVE THE CURRENT FILE");
                    message.setAlignment(java.awt.Label.CENTER);
                    info.add(message);
                    info.setLocation(this.getHeight()/2, this.getWidth()/2);
                    info.setVisible(true);
            }
    }//GEN-LAST:event_OpenDocActionPerformed

    private void SaveDocActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SaveDocActionPerformed

            String lines = textpane.getText();
            
            final FileDialog filedialog = new FileDialog(this,evt.getActionCommand(),FileDialog.SAVE);
            int x = this.getX();
            int y = this.getY();
            int x2 = 360;
            int y2 = 360;
            filedialog.setLocation(( x+(600/2)-x2/2) , (y+(670/2)-y2/2) );
            filedialog.addWindowListener(new WindowAdapter(){
            @Override
                public void windowClosing(WindowEvent e) {
                    filedialog.dispose();
                }
            });

            if(evt.getActionCommand().equals("Save As")){              //if click "Save as" MenuItem
                filepath = "";
            }

            if(!filepath.equals("") ){                         //if "save" and have path
                File file2 = new File(filepath,filename);
                    System.out.println(filepath+"\n\r"+filename);
                //MainFrame.this.saveinfotextfield.setText(filepath);
                try{
                    //System.out.println(filepath+"\n\r"+filename);
                    FileWriter fw = new FileWriter(file2);
                    fw.write(lines + "\r\n");
                    fw.close();

                    filesaved = true;
                    //MainFrame.this.saveinfotextfield.setText(filedialog.getDirectory());
                //    MainFrame.this.savecheckbox.setSelected(false);
                }catch(Exception e1){
                   // new InfoDialog("Save Wrong!",MainFrame.this.getX(),MainFrame.this.getY(),MainFrameWidth,MainFrameHeight);}
                }
            }
            else
                {                               //if path is ""  or "save as"
                filedialog.setVisible(true);
                if((filedialog.getDirectory()!=null) && (filedialog.getFile()!=null)){
                    file = new File(filedialog.getDirectory(),filedialog.getFile());     //set been saved file name
                    try{
                        FileWriter fw = new FileWriter(file);
                        fw.write(lines + "\r\n");
                        fw.close();
                        filesaved = true;
                    }catch(Exception e1){
                    setTitle(file.getName());
                    this.filepath = filedialog.getDirectory();
                    filename = file.getName();
                }
            }
       }
    }//GEN-LAST:event_SaveDocActionPerformed

    private void FindActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FindActionPerformed
        FindDialog findDialog = new FindDialog(this, false);
        findDialog.setVisible(true);
    }//GEN-LAST:event_FindActionPerformed

    private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed
        ReplaceDialog replaceDialog = new ReplaceDialog(this, false);
        replaceDialog.setVisible(true);
    }//GEN-LAST:event_jMenuItem9ActionPerformed

    /**
    * @param args the command line arguments
    */
   

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem10;
    private javax.swing.JMenuItem jMenuItem11;
    private javax.swing.JMenuItem jMenuItem12;
    private javax.swing.JMenuItem jMenuItem13;
    private javax.swing.JMenuItem jMenuItem14;
    private javax.swing.JMenuItem jMenuItem15;
    private javax.swing.JMenuItem jMenuItem16;
    private javax.swing.JMenuItem jMenuItem17;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JMenuItem jMenuItem8;
    private javax.swing.JMenuItem jMenuItem9;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JPopupMenu.Separator jSeparator2;
    // End of variables declaration//GEN-END:variables

}
